authInterceptorService.$inject = ['$rootScope'];

function authInterceptorService($rootScope) {
    return {
        request: function(config) {
            if (localStorage.getItem("token")) {
                config.headers.Authorization = 'Bearer ' + localStorage.getItem("token");
            }
            return config;
        },
        /*
         * 超时处理、未授权、在这里定义规则
         */
        response: function(response) {
            return response;
        },
        responseError: function(response) {
            return response;
        }

    };
}
module.exports = authInterceptorService;